﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'proc_cm_AddDailyWordQuestion')
BEGIN
    PRINT 'Dropping Procedure proc_cm_AddDailyWordQuestion'
    DROP  Procedure  proc_cm_AddDailyWordQuestion
END
GO

PRINT 'Creating Procedure proc_cm_AddDailyWordQuestion'
GO

CREATE PROCEDURE [dbo].[proc_cm_AddDailyWordQuestion]
	@pDailyWordId uniqueidentifier
	,@pQuestionNum int
	,@pQuestionTxt nvarchar(1000)
	,@pAnswerTypeCd varchar(50)
	,@pChoicesXml nvarchar(max)
AS
BEGIN
	SET NOCOUNT ON

	INSERT INTO [dbo].[tbl_dailyword_question]
	(
		[dailyword_question_id]
		,[dailyword_id]
		,[question_num]
		,[question_txt]
		,[answer_type_cd]
		,[answer_txt]
	)
	VALUES
	(
		NEWID()
		,@pDailyWordId
		,@pQuestionNum
		,@pQuestionTxt
		,@pAnswerTypeCd
		,@pChoicesXml
	)
END
GO


GRANT EXEC ON dbo.proc_cm_AddDailyWordQuestion TO PUBLIC
GO

